import request from '../utils/request'

//登录
export const loginApi = (data) => request.get('/users/login', { params: data })

//查询用户信息  路径参数
export const getUserApi = (id) => request.get('/users', { params: { id } })

//注册
export const registerApi = (data) => request.post('/users/register', data)


//获取所有的用户
export const getAllUserApi = (id)=>request.get('/users/getAll',{params:{id}})


//通过关键字搜索用户
export const searchUserApi = (keyword)=>request.get('/users/search',{params:{keyword}})

//加好友
export const addFriendApi = (data)=>request.post('/users/addFriend',data)

//获得好友申请列表
export const getFriendApplyListApi = (id)=>request.get('/users/getFriendRequests',{params:{id}})


//同意好友申请
export const agreeFriendApi = (data)=>request.post('/users/agreeFriend', data)


//拒绝好友申请
export   const refuseFriendApi = (data)=>request.post('/users/rejectFriend', data)